<script setup>
import { onMounted, ref, watch } from 'vue'

const props = defineProps(['operationData'])
const list = ref([
  {
    distance: 118,
    snId: '直升机 && 滑翔伞'
  },
  {
    distance: 136,
    snId: '滑翔伞 && eVTOL'
  },
  {
    distance: 372,
    snId: 'eVTOL && 直升机'
  }
])
onMounted(() => {
  //   list.value = props.operationData.alertInfoList
})

watch(props, (val) => {
  //   list.value = val.operationData.alertInfoList
})
</script>
<template>
  <div class="card">
    <div class="table">
      <ul class="thead">
        <li>告警飞行器</li>
        <li>间隔距离</li>
      </ul>
      <ul class="tbody">
        <vue3-seamless-scroll
          :list="list"
          :step="0.3"
          :hover="true"
          :isRemUnit="true"
          :wheel="true"
          :delay="3"
          :limitScrollNum="5"
        >
          <li v-for="(item, index) in list" :key="index">
            <p>
              {{ item.snId }}
            </p>
            <p>{{ item.distance }} m</p>
          </li>
        </vue3-seamless-scroll>
      </ul>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.card {
  .table {
    width: 100%;
    padding: 10px;

    .thead {
      width: 100%;
      height: 37px;
      display: flex;
      background: url('@img/infrastructure/table_header_bg.png');
      background-size: 100% 100%;

      li {
        flex: 1;
        line-height: 37px;
        text-align: center;
      }
    }

    .tbody {
      height: 175px;
      overflow: hidden;
      li {
        display: flex;
        height: 37px;
        line-height: 37px;
        border-bottom: 1px solid #0f496c;

        &:nth-child(odd) {
          background-color: rgba(15, 73, 108, 0.3);
        }

        P {
          flex: 1;
          &:nth-child(1) {
            padding-left: 20px;
          }

          &:nth-child(2) {
            flex: 0 0 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
          }

          .type {
            width: 67px;
            height: 20px;
            line-height: 20px;
            text-align: center;
            background: rgba(0, 213, 255, 0.25);
            border-radius: 2px;
            border: 1px solid #00d5ff;
          }
        }
      }
    }
    .top-item {
      width: 20px;
      height: 20px;
      background: url('@img/management/top-item-bg.png');
      background-size: 100% 100%;
      text-align: center;
      color: #fff;
      font-family:
        PingFangSC,
        PingFang SC;
      font-size: 12px;
      line-height: 20px;
    }
    .bottom-item {
      width: 20px;
      height: 20px;
      background: url('@img/management/bottom-item-bg.png');
      background-size: 100% 100%;
      text-align: center;
      color: #fff;
      font-family: PingFang SC;
      font-weight: 400;
      font-size: 12px;
      line-height: 20px;
    }
    .view {
      display: flex;
      justify-content: start;
      align-items: center;
      color: #00d5ff;
      cursor: pointer;
      img {
        display: block;
        height: 15px;
      }
    }
  }
}
</style>
